<?php

/*
|--------------------------------------------------------------------------
| Routes File
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

// Route::get('/', function () {
//     return view('home/index');
// });
//前台首页
Route::get('/','HomeController@index');

// Route::resource('user','UserController');

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/

Route::group(['middleware'=>'login'],function () {
    //后台首页
	Route::get('/admin','AdminController@index');

	//用户管理
    Route::resource('user','UserController');

    //分类管理
    Route::resource('cate','CateController');

    //商品管理
    Route::resource('goods','GoodsController');

    //支付方式
    Route::resource('payment','PaymentController');

    //用户退出
    Route::get('/admin/logout','LoginController@logout');

});


Route::get('/admin/login','LoginController@login');
Route::post('/admin/login','LoginController@dologin');

//前台的登陆
// Route::



//前台的注册
Route::get('register','LoginController@register');

Route::get('email','WebController@email');

Route::get('phone','WebController@phone');